<div class="fadeIn">
  <br>
  <ol class="breadcrumb">
      <li class="active"><span class="glyphicon glyphicon-home" style="color:#23527c"></span>&nbsp;<mainpage></mainpage></li>
      <li class="active">监控工作台 / 环境监控 / tomcat监控</li>
  </ol>
<!--   <button class="btn btn-primary btn-sm marB15 marT15" data-toggle="modal" data-target="#add1" ng-click='edit()'><i class="icon-leaf"></i>监控配置</button>
 -->
  <div class="table-box" style='margin-top:15px;'>

    <table class="table table-bordered table-striped table-hover text-center bg-info">
        <thead >
        <tr class="info">
            <th class="text-center">名称</th>
            <th class="text-center">IP地址</th>
            <th class="text-center">端口</th>
            <th class="text-center">tomcat版本</th>
            <th class="text-center">JVM版本</th>
            <th class="text-center">操作系统</th>
            <th class="text-center">当前告警数</th>
            <th class="text-center">最近采集时间</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat='item in result'>
            <td><a >{{item.name}}</a></td><!-- ng-click='showData(item)' data-toggle="modal" data-target="#add2" -->
            <td class="w70">{{item.ip}}</td>
            <td>{{item.port}}</td>
            <td class="w70">{{item.ver}}</td>
            <td class="w70">{{item.jvm}}</td>
            <td class="w85">{{item.os}}</td>
            <td class="w115">{{item.warnCount}}</td>
            <td class="w115">{{item.lastTime}}</td>    
        </tr>
        
        </tbody>
    </table>
  </div>

    <!-- <page></page> -->
</div>


<!--添加程序弹窗-->
<div class="modal fade" id="add1" tabindex="-1" role="dialog" aria-labelledby="add1">
    <form name="form">
    <div class="modal-dialog" style="width:780px;" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="add11">tomcat监控配置</h4>
            </div>
            <div class="modal-body">           
            <div class="input-group marB15" style="width:310px;">
                <span class="input-group-addon">tomcat监控节点选择：</span>
                <select class="form-control" id="tomcatId" 
                ng-options='item.objId as item.objName for item in hostnames'
                ng-model='tomcatId'
                ng-change='selectTomcat()'
                >
                  
                </select>
            </div> 
            <table class="table table-bordered table-striped table-hover bg-info">
                <thead>
                <tr class="bg-info"><td colspan="7">预警接收人员配置：</td></tr>
                <tr>
                    <td>序号</td>
                    <td>预警接收人</td>
                    <td>手机</td>
                    <td>邮箱</td>
                    <td>人员类型</td>
                    <td>接收预警等级</td>
                    <td ng-style='addstyle'>操作</td>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat='item in addData.alarmusers'>
                    <td>{{$index+1}}</td>
                    <td>
                    <select class="form-control line3" class="receiveUser" 
                    ng-model='item.rceId' 
                    ng-disabled='isDisabled'
                    ng-change='changeRecUser($index)'
                    ng-options='i.rceId as i.receiveUser for i in alarmusers'></select>
                    </td>
                    <td><input type="text" class="form-control line3" ng-model='item.phone'></td>
                    <td><input type="text" class="form-control line3" ng-model='item.email'></td>
                    <td><select class="form-control line3" style="width:70px;" ng-model='item.userType'>
                    <option value="1">责任人</option>
                    <option value="0">关注人</option>
                    </select></td>
                    <td>
                        <label><input type="checkbox"                         
                        ng-model='item.recAlarmLevel1'
                        >1级</label>
                        <label class="marL10 marR10"><input type="checkbox"                       
                        ng-model='item.recAlarmLevel2'
                        >2级</label>
                        <label><input type="checkbox"                       
                        ng-model='item.recAlarmLevel3'
                        >3级</label>
                    </td>
                    <td ng-style='addstyle'><button class="btn btn-primary btn-sm" ng-click='delRecevier($index)'>删除</button></td>
                </tr>
                </tbody>
                
                <tfoot ng-style='addstyle'>
                 <tr><td> <a title='添加' class="glyphicon glyphicon-plus" ng-click='addRecevier()'></a></td></tr>
                </tfoot>
                
            </table>
            <table class="table table-bordered table-hover">
                <tr>
                    <td>序号</td>
                    <td>监控指标名称</td>
                    <td>阀值上限</td>
                    <td>阀值下限</td>
                    <td>监控说明</td>
                    <td>操作</td>
                </tr>
                <tr class="bg-info" ng-repeat='item in addData.indexnames'>
                    <td>{{$index+1}}</td>
                    <td>
                       <select  class="form-control line3"  
                        ng-disabled='isDisabled'
                        ng-model='item.keyId'
                        ng-options='i.keyId as i.keyNameCn for i in indexnames'
                        ></select>
                    </td>
                    <td><input type="text" class="form-control line3" ng-model='item.upperLimit'></td>
                    <td><input type="text" class="form-control line3" ng-model='item.lowerLimit'></td>
                    <td><input type="text" class="form-control line3" ng-model='item.remark'></td>
                    <td><a class="btn btn-sm btn-primary" ng-click='delIndex($index)'>删除</a></td>
                </tr>
                <tr>
                  <td>
                  <a title='添加' class="glyphicon glyphicon-plus" ng-click='addIndex()'></a></td>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td></td>
                </tr>
            </table>       
        </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary btn-sm" ng-click='editSave()'>保存</button>
            </div>
        </div>
    </div>
    </form>
</div>
</div>

<!-- 显示信息模态框 -->
<div class="modal fade" id="add2" tabindex="-1" role="dialog" aria-labelledby="add12">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4>信息</h4>
                </div>
                <div class="modal-body">
                  <div class="clearfix row padL15">
                    <div class="controls input-group left">
                     <div class="input-prepend input-group">
                       <span class="add-on input-group-addon"><i class="glyphicon glyphicon-calendar fa fa-calendar"></i></span>
                       <input type="text" readonly style="width: 200px" name="reservation" id="tomcatDate" class="form-control"  /> 
                       <span class="input-group-addon" ng-click='clearTime()'>清空</span>
                     </div>
                    </div>
                    <button class="btn btn-primary left marL15" id="search" ng-click='search()'><span class="glyphicon glyphicon-search"></span></button>
                  </div>
                  
                  <div class="row marT15">
                      <div class="left marL15" style="width:480px;">
                         <div class="borderBlack">
                             <h5 style="background: #fff;">基本信息</h5>
                             <table class="table table-bordered table-hover bg-info">
                               <tr>
                                   <td>名称</td>
                                   <td>{{showInfo.tName}}</td>
                               </tr>
                               <tr>
                                   <td>ip</td>
                                   <td>{{showInfo.tIp}}</td>
                               </tr>
                               <tr>
                                   <td>端口</td>
                                   <td> {{showInfo.tPort}}</td>
                               </tr>
                               <tr>
                                   <td>tomcat版本</td>
                                   <td>{{showInfo.tVersions}} </td>
                               </tr>
                               <tr>
                                   <td>jvm版本</td>
                                   <td> {{showInfo.jvmVersions}}</td>
                               </tr>
                               <tr>
                                   <td>操作系统</td>
                                   <td> {{showInfo.os}}</td>
                               </tr>
                               <tr>
                                   <td>最近采集时间</td>
                                   <td>{{showInfo.lastCollectionTime}}</td>
                               </tr>
                             </table>
                         </div> 

                      </div>
                      <div class="left marL10" style="width:350px;">
                           <div id="responseTime"></div>
                          <div id="memoryUsage" class="marT15"></div>                          
                      </div>
                  </div>
                  <div class="row marT15" style='margin-left:0px;'>
                    <div class="borderBlack">
                      <h5 style='background: #fff;'>监控指标</h5>

                      <div class="table-box">
                      <table class="table table-bordered table-hover bg-info">
                        <tr>
                          <td>总内存</td>
                          <td>可使用内存</td>
                          <td>已用内存</td>
                          <td>最大线程数</td>
                          <td>线程池线程数</td>
                          <td>运行线程数</td>
                          <td>总请求数</td>
                          <td>成功请求数</td>
                          <td>失败请求数</td>
                          <td>请求最长处理时间</td>
                        </tr>
                        <tr>
                          <td>{{showInfo.tomInfo.mem}}</td>
                          <td>{{showInfo.tomInfo.availableMem}}</td>
                          <td>{{showInfo.tomInfo.useMem}}</td>
                          <td>{{showInfo.tomInfo.maxThreads}}</td>
                          <td></td>
                          <td>{{showInfo.tomInfo.threads}}</td>
                          <td>{{showInfo.tomInfo.reqs}}</td>
                          <td>{{showInfo.tomInfo.reqsuc}}</td>
                          <td>{{showInfo.tomInfo.reqfail}}</td>
                          <td>{{showInfo.tomInfo.reqmaxtime}}</td>
                          
                        </tr>
                      </table>
                    </div>
                  </div>

                 

                </div>
               
            </div>
        </div>
    </div>
</div>
    <!-- 显示信息模态框结束 -->
<!-- 加载框 -->
  <span class='loaded' ng-show='loaded'><img  src="img/load.gif"></span>
<!-- 加载框 完成-->






